*Seeberg, MB. 2019.

use "U:\Data\Seeberg, MB. 2019. replication data..dta"

*Table 1

*vote
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
clogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce (cluster gwno) group(gwno)
xtreg v8v2ellovtlg v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*seat
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
clogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce (cluster gwno) group(gwno)
xtreg v8v2ellostsl v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)


*Figure 2
*predicted probabilities plot
quietly xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57(10)100)) 
marginsplot, level(90) recast(scatter) title("Votes") ytitle("predicted probability of 60%") xtitle("state territorial control") saving (predprob60ofvote)

quietly xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57(10)100)) 
marginsplot, level(90) recast(scatter) title("Seats") ytitle("predicted probability of 60%") xtitle("state territorial control") saving (predprob60ofseat)

gr combine "predprob60ofvote" "predprob60ofseat", iscale(1) ycommon 



*Table 2
*media bias
xtlogit nelda16_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit nelda16_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
clogit nelda16_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce (cluster gwno) group(gwno)
*opposition prevented
xtlogit nelda13_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit nelda13_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
clogit nelda13_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce (cluster gwno) group(gwno)

*Table 3
*other irreg
xtreg v8v2elirreg v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtreg v8v2elirreg v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtreg v8v2elirreg v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, fe vce(cluster gwno)
*domestic monitors
xtlogit v8v2eldommon v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8v2eldommon v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
clogit v8v2eldommon v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce (cluster gwno) group(gwno)


*Figure 3
*coef plot of manip -->victory
quietly xtlogit v8lgparty60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5a
quietly xtlogit  v8lagpartseat60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5b
quietly xtlogit v8lgparty60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5e
quietly xtlogit  v8lagpartseat60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5f
quietly xtlogit v8lgparty60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5g
quietly xtlogit  v8lagpartseat60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5h
quietly xtlogit v8lgparty60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5c
quietly xtlogit v8lagpartseat60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
estimates store T5d

coefplot T5a T5e T5g T5c, bylabel(60% votes)   ///
      || T5b T5d T5h T5f , bylabel(60% seats)  ///
      ||, drop(_cons LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration) levels(90) xline(0) byopts(xrescale)  mlabcolor(black) mcolor(black) lcolor(black) 


*Table 4: state cap --> overt manip
xtlogit nelda33_num v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit nelda33_num v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit nelda33_num v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas e_Civil_War gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
clogit nelda33_num v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce (cluster gwno) group(gwno)


*APPENDIX

*Table B: descriptive statistics
summ v8terr3yearav v8lgparty60 v8lagpartseat60 v8v2ellovtlg v8v2ellostsl ///
nelda13_summ ///
v8v2elfrcamp nelda16_summ v8v2elirreg v8v2eldommon nelda33_num sr13viol if MulParElec4617==1

*Table D1: Predicted probabilities
*predicted probabilities
*votes
quietly xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8terr3yearav if e(sample)==1, detail
*min and max
margins, at(v8terr3yearav=(57 100)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)
*seats
quietly xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8terr3yearav if e(sample)==1, detail
*min and max
margins, at(v8terr3yearav=(57 100)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)
*predicted probabilities, state --> media bias
quietly xtlogit nelda16_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8terr3yearav if e(sample)==1 
margins, at(v8terr3yearav=(57 100)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit nelda16_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)
*predicted probabilities, state --> opposition prevented
quietly xtlogit nelda13_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8terr3yearav if e(sample)==1 
margins, at(v8terr3yearav=(57 100)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit nelda13_summ v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)
*predicted probabilities, state --> monitors
quietly xtlogit v8v2eldommon v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8terr3yearav if e(sample)==1
margins, at(v8terr3yearav=(57 100)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8v2eldommon v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)
*predicted probabilities, state --> violence
quietly xtlogit nelda33_num v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8terr3yearav if e(sample)==1
margins, at(v8terr3yearav=(57 100)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit nelda33_num v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)


*Table D2: predicted probabilities
*pred prob, media bias --> victories
*votes
quietly xtlogit v8lgparty60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda16_summ=(0 1)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8lgparty60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda16_summ=(0 1)) contrast (atcontrast(r)) level(90)
*seats
quietly xtlogit  v8lagpartseat60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda16_summ=(0 1)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit  v8lagpartseat60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda16_summ=(0 1)) contrast (atcontrast(r)) level(90)
*pred prob, opp prevented --> victories
*votes
quietly xtlogit v8lgparty60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda13_summ=(0 1)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8lgparty60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda13_summ=(0 1)) contrast (atcontrast(r)) level(90)
*seats
quietly xtlogit  v8lagpartseat60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda13_summ=(0 1)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit  v8lagpartseat60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(nelda13_summ=(0 1)) contrast (atcontrast(r)) level(90)
*pred prob, other voting irreg --> victories
*votes
quietly xtlogit v8lgparty60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8v2elirreg if e(sample)==1
margins, at(v8v2elirreg=( -3.05133 2.361428)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8lgparty60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8v2elirreg=( -3.05133 2.361428)) contrast (atcontrast(r)) level(90)
*seats
quietly xtlogit  v8lagpartseat60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
summ v8v2elirreg if e(sample)==1
margins, at(v8v2elirreg=(-3.05133 2.361428)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit  v8lagpartseat60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8v2elirreg=(-3.05133 2.361428)) contrast (atcontrast(r)) level(90)
*pred prob, monitors --> victories
*votes
quietly xtlogit v8lgparty60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8v2eldommon=(0 1)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8lgparty60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8v2eldommon=(0 1)) contrast (atcontrast(r)) level(90)
*seats
quietly xtlogit v8lagpartseat60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8v2eldommon=(0 1)) level(90)
*Comparing predicted prob for x at min and max
quietly xtlogit v8lagpartseat60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8v2eldommon=(0 1)) contrast (atcontrast(r)) level(90)

*Table E1: additional controls 
*civil war
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar e_Civil_War gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar e_Civil_War gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*reserved seats for women
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar resseatwom gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar resseatwom gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*controlling for and excluding cases with (potential) restrictions on seat share
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar restrict gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1 & restrict!=1 , vce(cluster gwno)


*Table E2: additional controls 
*controlling for and exlcuding opposition victory
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar oppvic gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar oppvic gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1 & oppvic==0, vce(cluster gwno)
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1 & oppvic==0 , vce(cluster gwno)
*excluding monarchies
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1 & gwf_monarchy==0, vce(cluster gwno)
xtlogit v8lagpartseat60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1 & gwf_monarchy==0, vce(cluster gwno)


*Table F: large majorities, robustness checks (alternative thresholds) 
xtlogit v8lgparty55 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lgparty58 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lgparty62 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lgparty65 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat55 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat58 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat62 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lagpartseat65 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)


*Table I: subtle manip, extra analyses
*free media access
xtreg v8v2elfrcamp v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtreg v8v2elfrcamp  v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)


*Table J: Subtle manipulation --> supermajority victory
*Media bias --> vote
xtlogit v8lgparty60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*Media bias --> seat
xtlogit  v8lagpartseat60 nelda16_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*opp prevented --> vote
xtlogit v8lgparty60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*opp prevented --> seat
xtlogit  v8lagpartseat60 nelda13_summ LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*votin irreg --> vote
xtlogit v8lgparty60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*votin irreg --> seat
xtlogit  v8lagpartseat60 v8v2elirreg LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*domestic mon restricted --> vote
xtlogit v8lgparty60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
*domestic mon restricted --> seat
xtlogit v8lagpartseat60 v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)


*Table K: mediation analysis vote60, all mechanisms at once
xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtlogit v8lgparty60 v8terr3yearav nelda16_summ nelda13_summ v8v2elirreg v8v2eldommon  LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)


*pred prob
*without mediators
quietly xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=57) 
margins, at(v8terr3yearav=100) 
*Comparing predicted prob for x at min and max
quietly xtlogit v8lgparty60 v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)
*with mediators
quietly xtlogit v8lgparty60 v8terr3yearav nelda16_summ nelda13_summ v8v2elirreg v8v2eldommon  LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=57) 
margins, at(v8terr3yearav=100) 
*Comparing predicted prob for x at min and max
quietly xtlogit v8lgparty60 v8terr3yearav nelda16_summ nelda13_summ v8v2elirreg v8v2eldommon LAGGDP LAGgrowth LAGLogOilGas majoritar gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
margins, at(v8terr3yearav=(57 100)) contrast (atcontrast(r)) level(90)

*Table M: overt manip, alternative violence measure
xtreg sr13viol v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtreg sr13viol v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas gwf_party Agwfnelda_firstelec gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtreg sr13viol v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas e_Civil_War gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, vce(cluster gwno)
xtreg sr13viol v8terr3yearav LAGGDP LAGgrowth LAGLogOilGas  gwf_duration SqGwf_duration CubedGwf_duration if MulParElec4617==1, fe vce (cluster gwno) 


*Table J: cases
sort country year
br country year if MulParElec4617==1


*correlation between state terr control and civil war
*pearsons
pwcorr v8terr3yearav e_Civil_War if MulParElec4617==1
codebook e_Civil_War if MulParElec4617==1
